package com.zhuiyun.educations.api.starTeacher.controller;
import com.zhuiyun.educations.api.course.mapper.CourseMapper;
import com.zhuiyun.educations.api.teacher.mapper.TeacherMapper;
import com.zhuiyun.educations.common.response.CommonResult;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName StarTeacher
 * @Description TODO
 * @Author 12295
 * @Date 2023/6/26 11:22
 **/
@RestController
@CrossOrigin
@RequestMapping("/starTeacher")
public class StarTeacher {

    @Resource
    private TeacherMapper teacherMapper;
    @Resource
    private CourseMapper courseMapper;


    /**
    * @Author yangze
    * @Description 教师查询
    * @Date 2023/6/26 16:06
    * @Return
    * @param
    */

    @GetMapping("/StarTeacherList")
    public CommonResult StarTeacherList(){
        return CommonResult.ok(teacherMapper.selectAll());
    }


    /**
    * @Author yangze
    * @Description  教师课程查询
    * @Date 2023/6/26 16:07
    * @Return
    * @param teacherId
    */

    @GetMapping("/StarTeacherCourseList")
    public CommonResult StarTeacherCourseList(Integer teacherId){
        return CommonResult.ok(courseMapper.selectByTeacherId(teacherId));



    }

}
